package com.zsx.shopping.common.api.user.feign;

import com.zsx.shopping.common.api.R;
import com.zsx.shopping.common.api.user.dto.LoginDto;
import com.zsx.shopping.common.api.user.dto.RegisterDto;
import com.zsx.shopping.common.api.user.vo.ReceiveAddressVO;
import com.zsx.shopping.common.session.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("shopping-user")
public interface UserFeignService {

    @PostMapping("/user/user/register")
    R<Void> register(@RequestBody RegisterDto registerDto);

    @PostMapping("/user/user/login")
    R<UserVO> login(@RequestBody LoginDto loginDto);

    @GetMapping("/user/receiveAddress/receiveAddress")
    R<ReceiveAddressVO> getReceiveAddress(@RequestParam("receiveAddressId") Long receiveAddressId);

    @GetMapping("/user/receiveAddress/seckill/defaultReceiveAddress")
    R<ReceiveAddressVO> getDefaultReceiveAddress(@RequestParam("userId") Long userId);
}
